﻿using CardPlay.Model.CardModel;
using CardPlay.Model.GameModel;
using CardPlay.Model.GameModel.Actions;
using CardPlay.Model.Layout;

namespace CardPlay.DemoPack.Games.KlondikeVariants
{
    [Game("8E10C734-0F08-43D1-83E2-2E61F076171B", LevelOfDifficulty.Easy, LevelOfSkill.MostlyChance, DurationOfPlay.Within5To10Minutes, Family = FamilyName)]
    public class Somerset : Klondike
    {
        public Somerset()
        {
            NamesOfAdditionalPiles.Clear();
            FoundationRowAlignment = HorizontalAlignment.Center;

            TotalTableaus = 10;
            MaximumDeals = 1;

        }

        protected override void PrepareDealScript(DealScript script)
        {
            DealToTableau(script, CardOrientation.FaceUp);
        }

        protected override bool AllowedToPickupAtTableau(RemovePileAction action)
        {
            return action.IsActingOnFaceUpTopCard();
        }

        protected override bool AllowedToBuildEmptyTableau(MovePileAction action)
        {
            return action.PileBeingMoved.BottomCard.Rank != FoundationBaseRank;
        }
    }
}